<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head id="MyHead">
<script src="../resources/Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../resources/Scripts/JScriptIndex.js" type="text/javascript"></script>
<script src="../resources/Scripts/jquery.easyui.min-1.3.5.js" type="text/javascript"></script>
<link href="../resources/Content/Default.css" rel="stylesheet" type="text/css" />
<link href="../resources/Content/IndexStyle.css" rel="stylesheet" type="text/css" />
<link href="../resources/Res/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<script src="../resources/Res/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<link href="../resources/Res/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<title></title>
<script type="text/javascript" language="javascript">
	$(function() {
		$
				.extend(
						$.fn.datagrid.methods,
						{
							addToolbarItem : function(jq, items) {
								return jq
										.each(function() {
											var dpanel = $(this).datagrid(
													'getPanel');
											var toolbar = dpanel
													.children("div.datagrid-toolbar");
											if (!toolbar.length) {
												toolbar = $(
														"<div class=\"datagrid-toolbar\"><table cellspacing=\"0\" cellpadding=\"0\"><tr></tr></table></div>")
														.prependTo(dpanel);
												$(this).datagrid('resize');
											}
											var tr = toolbar.find("tr");
											for (var i = 0; i < items.length; i++) {
												var btn = items[i];
												if (btn == "-") {
													$(
															"<td><div class=\"datagrid-btn-separator\"></div></td>")
															.appendTo(tr);
												} else {
													var td = $("<td></td>")
															.appendTo(tr);
													var b = $(
															"<a href=\"javascript:void(0)\"></a>")
															.appendTo(td);
													b[0].onclick = eval(btn.handler
															|| function() {
															});
													b.linkbutton($.extend({},
															btn, {
																plain : true
															}));
												}
											}
										});
							},
							removeToolbarItem : function(jq, param) {
								return jq
										.each(function() {
											var dpanel = $(this).datagrid(
													'getPanel');
											var toolbar = dpanel
													.children("div.datagrid-toolbar");
											var cbtn = null;
											if (typeof param == "number") {
												cbtn = toolbar.find("td").eq(
														param).find(
														'span.l-btn-text');
											} else if (typeof param == "string") {
												cbtn = toolbar
														.find("span.l-btn-text:contains('"
																+ param + "')");
											}
											if (cbtn && cbtn.length > 0) {
												cbtn.closest('td').remove();
												cbtn = null;
											}
										});
							}
						});
	});
</script>




<script language="javascript" type="text/javascript">
	$(function() {
		setTimeout(function() {
			getData("1");
		}, 1000); //读取本月分点 
		setTimeout(function() {
			getData("2");
		}, 2000); //读取本月分点  
		setTimeout(function() {
			getData("3");
		}, 3000); //读取本月分点 
		setTimeout(function() {
			getData("4");
		}, 4000); //读取本月分点       
	});

	//js过滤HTML标签以及空格
	function removeHTMLTag(str) {
		str = str.replace(/<\/?[^>]*>/g, ''); //去除HTML tag
		str = str.replace(/[ | ]*\n/g, '\n'); //去除行尾空白
		//str = str.replace(/\n[\s| | ]*\r/g,'\n'); //去除多余空行
		str = str.replace(/ /ig, ''); //去掉 
		return str;
	}

	function getData(typeStr) {

		var search = $('#riqiKemu1Start_Time').val() + ','
				+ $('#riqiKemu1End_Time').val()
				+ ",201301301444110156250c451035ec5" + ","+"kemu1";
		var toobar = "#SearchKemu1";

		if (typeStr == "2") {
			search = $('#riqiKemu2Start_Time').val() + ','
					+ $('#riqiKemu2End_Time').val()
					+ ",20130130173022453125039df785212" + ","+"kemu2";
			toobar = "#SearchKemu2";
		}

		if (typeStr == "3") {
			search = $('#riqiKemu3Start_Time').val() + ','
					+ $('#riqiKemu3End_Time').val()
					+ ",201303011352109531250c061f1b805" + ","+"kemu3";
			toobar = "#SearchKemu3";
		}

		if (typeStr == "4") {
			search = $('#riqiKemu4Start_Time').val() + ','
					+ $('#riqiKemu4End_Time').val()
					+ ",20130301135250515625081e946c869" + ","+"kemu4";
			toobar = "#SearchKemu4";
		}

		$('#flexigridDataKemu' + typeStr).datagrid({
			//title: '预约列表', //列表的标题
			iconCls : 'icon-site',
			width : 'auto',
			height : 'auto',
			nowrap : true,
			striped : true,
			collapsible : true,
			toolbar : toobar,
			loadMsg : '数据计算中,请稍等...',
			url : '/showCount', //获取数据的url
			queryParams : {
				search : search
			},
			sortName : 'PK_ID',
			sortOrder : 'desc',
			idField : 'PK_ID',
			
			pageList : [ 100, 200, 300 ],
			pagination : true,
			rownumbers : true

		});

	}
	function daochuExcel(strType) {

		if (confirm("系统提示：确认要导出吗？")) {

			window.location.href = "?act=daochuExcel&strType=" + strType;
		} else {
			return false;
		}

	}
	//科目一查询
	function findData(strType) {

		var riqiStart_Time = $("#riqiKemu" + strType + "Start_Time").val(); //关键字
		var riqiEnd_Time = $("#riqiKemu" + strType + "End_Time").val(); //关键字
		var cheXing = $("#CheXingKemu" + strType).combobox("getValue"); //车型

		var kemuStr = "201301301444110156250c451035ec5";
		if (strType == "2") {
			kemuStr = "20130130173022453125039df785212";
		}

		if (strType == "3") {
			kemuStr = "201303011352109531250c061f1b805";
		}

		if (strType == "4") {
			kemuStr = "20130301135250515625081e946c869";
		}

		var search = riqiStart_Time + ',' + riqiEnd_Time + "," + kemuStr + ","
				+ cheXing;

		if (riqiStart_Time == "") {
			$.message.alert('系统提示', '请输入开始日期', 'info');
			return false;
		}

		if (riqiEnd_Time == "") {
			$.message.alert('系统提示', '请输入开始日期', 'info');
			return false;
		}
		//执行查询
		//alert(search1);
		$('#flexigridDataKemu' + strType).datagrid('reload', {
			search : search
		});
	}
</script>
<script src="/Res/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<base target="_self">
</head>
<body>
	<div class="easyui-panel" fit="true" style="width: 985px; height: 563px; padding: 5px;" border="false">
		<div class="easyui-tabs" data-options="tabWidth:180" fit="true">
			<div title="科目(一)考试统计表" style="padding: 5px;">
				<table class="easyui-datagrid" id="flexigridDataKemu1" data-options="fit:true">
					<thead>
						<tr>
							<th
								data-options="field:'stuAssignsSchool',width:100,align:'left',styler: function (value, row, index) {return 'background-color:#336699;color:white';}"
								rowspan="2">分校</th>

<!-- 							<th colspan="3">报考结果</th>  -->
							<th>报考结果</th> 
							<th colspan="2">参加结果</th>
							<th colspan="2">考试结果</th>
							<th
								data-options="field:'passPercent',width:100,align:'right' ,styler: function (value, row, index) {return 'background-color:#b45b3e;color:white';}"
								rowspan="2">合格率</th>
						</tr>
						<tr>

							<th
								data-options="field:'applyCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考人数</th>
<!-- 							<th
								data-options="field:'applySuccessCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">报考成功</th>
							<th
								data-options="field:'applyFailCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考失败</th> -->

							<th
								data-options="field:'attendCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">参加人数</th>
							<th
								data-options="field:'missCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">缺考人数</th>

							<th
								data-options="field:'passCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">合格人数</th>
							<th
								data-options="field:'failCount',width:80,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">不合格人数</th>

						</tr>
					</thead>
				</table>
			</div>
			<div title="科目(二)考试统计表" style="padding: 5px;">
				<table id="flexigridDataKemu2" fit="true">
					<thead>
						<tr>
							<th
								data-options="field:'stuAssignsSchool',width:100,align:'left',styler: function (value, row, index) {return 'background-color:#336699;color:white';}"
								rowspan="2">分校</th>
<!-- 							<th colspan="3">报考结果</th>  -->
							<th>报考结果</th> 
							<th colspan="2">参加结果</th>
							<th colspan="2">考试结果</th>
							<th
								data-options="field:'passPercent',width:100,align:'right',styler: function (value, row, index) {return 'background-color:#b45b3e;color:white';}"
								rowspan="2">合格率</th>
						</tr>
						<tr>

						 	<th
								data-options="field:'applyCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考人数</th>
<!-- 							<th
								data-options="field:'applySuccessCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">报考成功</th>
							<th
								data-options="field:'applyFailCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考失败</th>  -->

							<th
								data-options="field:'attendCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">参加人数</th>
							<th
								data-options="field:'missCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">缺考人数</th>

							<th
								data-options="field:'passCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">合格人数</th>
							<th
								data-options="field:'failCount',width:80,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">不合格人数</th>

						</tr>
					</thead>

				</table>
			</div>

			<div title="科目(三)考试统计表" style="padding: 5px;">
				<table id="flexigridDataKemu3" fit="true">

					<thead>
						<tr>
							<th
								data-options="field:'stuAssignsSchool',width:100,align:'left',styler: function (value, row, index) {return 'background-color:#336699;color:white';}"
								rowspan="2">分校</th>
<!-- 							<th colspan="3">报考结果</th>  -->
							<th>报考结果</th> 
							<th colspan="2">参加结果</th>
							<th colspan="2">考试结果</th>
							<th
								data-options="field:'passPercent',width:100,align:'right',styler: function (value, row, index) {return 'background-color:#b45b3e;color:white';}"
								rowspan="2">合格率</th>
						</tr>
						<tr>
							<th
								data-options="field:'applyCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考人数</th>
<!-- 							<th
								data-options="field:'applySuccessCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">报考成功</th>
							<th
								data-options="field:'applyFailCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考失败</th> -->

							<th
								data-options="field:'attendCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">参加人数</th>
							<th
								data-options="field:'missCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">缺考人数</th>

							<th
								data-options="field:'passCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">合格人数</th>
							<th
								data-options="field:'failCount',width:80,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">不合格人数</th>

						</tr>
					</thead>

				</table>
			</div>

			<div title="科目(三)理论考试统计表" style="padding: 5px;">
				<table id="flexigridDataKemu4" fit="true">

					<thead>
						<tr>
							<th
								data-options="field:'stuAssignsSchool',width:100,align:'left',styler: function (value, row, index) {return 'background-color:#336699;color:white';}"
								rowspan="2">分校</th>

<!-- 							<th colspan="3">报考结果</th>  -->
							<th>报考结果</th> 
							<th colspan="2">参加结果</th>
							<th colspan="2">考试结果</th>
							<th
								data-options="field:'passPercent',width:100,align:'right',styler: function (value, row, index) {return 'background-color:#b45b3e;color:white';} "
								rowspan="2">合格率</th>
						</tr>
						<tr>

						 	<th
								data-options="field:'applyCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考人数</th>
<!-- 							<th
								data-options="field:'applySuccessCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">报考成功</th>
							<th
								data-options="field:'applyFailCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">报考失败</th> -->

							<th
								data-options="field:'attendCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">参加人数</th>
							<th
								data-options="field:'missCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">缺考人数</th>

							<th
								data-options="field:'passCount',width:70,align:'right',styler: function (value, row, index) {return 'background-color:#f0dad2';}">合格人数</th>
							<th
								data-options="field:'failCount',width:80,align:'right',styler: function (value, row, index) {return 'background-color:#d7fff0';}">不合格人数</th>

						</tr>
					</thead>

				</table>
			</div>

		</div>
	</div>

	<div id="stuAssignsSchoolSearch" style="padding: 5px;">
		<div class="row">
			<span>&nbsp;查询日期：</span> 
			<input class="input-textbox"
				onclick="WdatePicker({maxDate:'#F{$dp.$D(\'riqiKemu1End_Time\');}'})"
				type="text" id="riqiKemu1Start_Time" value='2018-01-01' size="10" />
			&nbsp;到&nbsp;&nbsp; 
			<input class="input-textbox"
				onclick="WdatePicker({minDate:'#F{$dp.$D(\'riqiKemu1Start_Time\');}'})"
				type="text" id="riqiKemu1End_Time" value='2018-01-29' size="10" />
			&nbsp;车型： 
			<select class="easyui-combobox" id="CheXingKemu1"
				name="CheXingKemu1" style="width: 80px;">
				<option value="">请选择</option>
				<option value="20130819150209578125066d0a9bd68">C1</option>
				<option value="201403190851049953614a850002db0">C2</option>
			</select> &nbsp; 
			<a href="javascript:findData('1');" class="easyui-linkbutton"
				data-options="iconCls:'icon-search'">统计</a> &nbsp; 
			<a href="#"
				onclick="daochuExcel('1');" class="easyui-linkbutton"
				data-options="iconCls:'icon-excel'">导出EXCEL</a>
		</div>
	</div>

	<div id="stuAssignsSchoolSearchKemu2" style="padding: 5px;">
		<div class="row">
			<span>&nbsp;查询日期：</span> <input class="input-textbox"
				onclick="WdatePicker({maxDate:'#F{$dp.$D(\'riqiKemu2End_Time\');}'})"
				type="text" id="riqiKemu2Start_Time" value='2018-01-01' size="10" />&nbsp;到&nbsp;&nbsp;
			<input class="input-textbox"
				onclick="WdatePicker({minDate:'#F{$dp.$D(\'riqiKemu2Start_Time\');}'})"
				type="text" id="riqiKemu2End_Time" value='2018-01-29' size="10" />&nbsp;车型：

			<select class="easyui-combobox" id="CheXingKemu2" name="CheXingKemu2"
				style="width: 80px;">
				<option value="">请选择</option>
				<option value="20130819150209578125066d0a9bd68">C1</option>
				<option value="201403190851049953614a850002db0">C2</option>
			</select> &nbsp; <a href="javascript:findData('2');" class="easyui-linkbutton"
				data-options="iconCls:'icon-search'">统计</a> &nbsp; <a href="#"
				onclick="daochuExcel('2');" class="easyui-linkbutton"
				data-options="iconCls:'icon-excel'">导出EXCEL</a>
		</div>
	</div>

	<div id="stuAssignsSchoolSearchKemu3" style="padding: 5px;">
		<div class="row">
			<span>&nbsp;查询日期：</span>
			<input class="input-textbox"
				onclick="WdatePicker({maxDate:'#F{$dp.$D(\'riqiKemu3End_Time\');}'})"
				type="text" id="riqiKemu3Start_Time" value='2018-01-01' size="10" />
			&nbsp;到&nbsp;&nbsp;
			<input class="input-textbox"
				onclick="WdatePicker({minDate:'#F{$dp.$D(\'riqiKemu3Start_Time\');}'})"
				type="text" id="riqiKemu3End_Time" value='2018-01-29' size="10" />
			&nbsp;车型：
			<select class="easyui-combobox" id="CheXingKemu3"
				name="CheXingKemu3" style="width: 80px;">
				<option value="">请选择</option>
				<option value="20130819150209578125066d0a9bd68">C1</option>
				<option value="201403190851049953614a850002db0">C2</option>
			</select> &nbsp;
			<a href="javascript:findData('3');" class="easyui-linkbutton"
				data-options="iconCls:'icon-search'">统计</a> &nbsp;
			<a href="#"
				onclick="daochuExcel('3');" class="easyui-linkbutton"
				data-options="iconCls:'icon-excel'">导出EXCEL</a>
		</div>
	</div>

	<div id="stuAssignsSchoolSearchKemu4" style="padding: 5px;">
		<div class="row">
			<span>&nbsp;查询日期：</span>
			
			<input class="input-textbox"
				onclick="WdatePicker({maxDate:'#F{$dp.$D(\'riqiKemu4End_Time\');}'})"
				type="text" id="riqiKemu4Start_Time" value='2018-01-01' size="10" />
			&nbsp;到&nbsp;&nbsp;
			
			<input class="input-textbox"
				onclick="WdatePicker({minDate:'#F{$dp.$D(\'riqiKemu4Start_Time\');}'})"
				type="text" id="riqiKemu4End_Time" value='2018-01-29' size="10" />
			&nbsp;车型：
			
			<select class="easyui-combobox" id="CheXingKemu4"
				name="CheXingKemu4" style="width: 80px;"><option value="">请选择</option>
				<option value="20130819150209578125066d0a9bd68">C1</option>
				<option value="201403190851049953614a850002db0">C2</option>
			</select> &nbsp;
			
			<a href="javascript:findData('4');" class="easyui-linkbutton"
				data-options="iconCls:'icon-search'">统计</a> &nbsp;
			
			<a href="#"
				onclick="daochuExcel('4');" class="easyui-linkbutton"
				data-options="iconCls:'icon-excel'">导出EXCEL</a>
		</div>
	</div>
</body>
</html>
